<!-- 门店排队 -->
<template>
	<view>
		<view class="d_box">
			<uni-datetime-picker v-model="range" type="daterange" @change="maskClick" />
		</view>
		<view class="line_list">
			<view class="line_item flex_between" v-for="item in list">
				<view>
					<view class="line_tit">{{item.title}}</view>
					<view class="line_con">{{item.show_time}}</view>
				</view>
				<view class="line_import">{{item.money}}</view>
			</view>
			<view class="empty_loading">
				<image v-if="isloading" src="../../static/business/loading.gif" ></image>
				<view v-if="ismore">到底了~</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isloading: false,
				ismore: false,
				page: 0,
				list: [],
				id: 0,
				supname: '',
				price: '',
				ratemoney: '',
				money: '',
				sendmoney: '',
				start_date: '',
				end_date: '',
				range: ''
			};
		},
		onLoad(options) {
			if (options.id) {
				this.id = options.id;
				this.getList();
			}
		},
		onReachBottom() {
			this.getList();
		},
		methods: {
			getList() {
				this.page++;
				this.isloading = true;
				this.$axios('UserStatistics/sub_det_lst', 'POST', 'pt', {
					page: this.page,
					orderid: this.id,
					start_date: this.start_date,
					end_date: this.end_date
				}).then(res => {
					this.isloading = false;
					if (res.data.code == 200) {
						this.list = [...this.list, ...res.data.data.list];
						this.ismore = res.data.data.list.length <= 0;
					}
				})
			},
			maskClick(e) {
				this.start_date = e[0]
				this.end_date = e[1]
				this.page = 0
				this.list = []
				this.getList()
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #FBF8FE;
		padding-bottom: 60rpx;
	}

	::v-deep .uni-calendar-item--before-checked,
	::v-deep .uni-calendar-item--after-checked,
	::v-deep .uni-datetime-picker--btn {
		background-color: #8813E2 !important;
	}

	::v-deep .selected-item-active {
		border-bottom: 2px solid #8813E2;
	}
	::v-deep .selected-item-active {
		border-bottom: 2px solid #8813E2;
	}

	.d_box {
		margin-top: 10rpx;
		padding: 20rpx;
	}

	.line_info {
		padding: 10rpx 30rpx;
		line-height: 50rpx;
	}

	.line_tit {
		font-weight: 600;
	}

	.line_con {
		color: #999999;
	}

	.line_import {
		color: $bg-color;
		font-weight: 600;
	}

	.line_list {
		padding: 0 24rpx;

		.line_item {
			margin-bottom: 20rpx;
			background: #FFFFFF;
			border-radius: 12rpx;
			padding: 10rpx 20rpx;
			font-size: 26rpx;
			line-height: 44rpx;

			.line_tit {
				font-size: 28rpx;
			}
		}
	}
</style>